#define _CRT_SECURE_NO_WARNINGS 1
#include <iostream>
#include <string>
using namespace std;

int main()
{
    string s;
    cin >> s;
    int n = s.size();
    int x = 1;
    int sum = 0;
    for (int i = 0;i < n - 1;i++)
    {
        if (s[i] >= '0' && s[i] <= '9')
        {
            sum += ((s[i] - '0') * x);
            ++x;
            cerr << "x=" << x << ",sum=" << sum << endl;
        }
    }
    sum %= 11;
    char id;
    if (sum < 10) id = sum + '0';
    else id = 'X';
    cerr << "id=" << id << endl;
    if (id == s[n - 1]) cout << "Right" << endl;
    else
    {
        s[n - 1] = id;
        cout << s << endl;
    }
    return 0;
}
